/**
 * 已选择待发布公告图像列表
 */
Ext.define('DragonApp.view.notice.SelectedGrid', {
    extend: 'DragonApp.view.foundation.ImgGrid',

    alias: ['widget.selectedgrid'],

    controller: 'noticeimagegrid',
    plugins: [{
        ptype: 'gridfilters'
    }],
    viewConfig: {
        plugins: {
            ptype: 'gridviewdragdrop',
            dragText: '拖拽图像排序'
        }
    },
    selModel: {
        selType: 'checkboxmodel'
    },
    requires: [
        'DragonApp.util.File',
        'DragonApp.util.String',
        'Ext.grid.filters.Filters',
        'DragonApp.store.JsonPTag',
        'DragonApp.view.notice.Bar',
        'DragonApp.store.ImageModel',
        'DragonApp.view.notice.SelectedBar',
        'Ext.overrides.locale.zh_CN.Filters'
    ],

    dockedItems: [{
        xtype: 'notice-selected-bar',
        dock: 'top'
    }],

    columns: [{
            text: '序号',
            xtype: 'rownumberer',
            hideable: false,
            width: 70,
            align: 'center'
        },
        {
            text: '文件名称',
            dataIndex: 'filename',
            hideable: false,
            width: 150,
            align: 'center'
        },
        {
            text: '类型',
            dataIndex: 'ext',
            hideable: false,
            width: 100,
            align: 'center',
            filter: {
                type: 'list',
                options: ['jpg', 'png', 'gif']
            }
        },
        { text: '大小', dataIndex: 'filesize', hideable: false, width: 100, align: 'center', renderer: DragonApp.util.File.bytesToSize },
        { text: '宽度', dataIndex: 'width', hideable: false, width: 100, align: 'center', hidden: true },
        { text: '高度', dataIndex: 'height', hideable: false, width: 100, align: 'center', hidden: true },
        { text: '修改时间', dataIndex: 'lastmodtime', hideable: false, width: 145, align: 'center' },
        { text: '文件路径', dataIndex: 'path', hideable: false, flex: 1, align: 'center', renderer: DragonApp.util.String.contentRender }
    ],

    store: {
        type: 'imagemodel',
        storeId: 'selectedStore',
        trackRemoved: false
    }
});